package com.wxz.sanguo.game;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.font.TextAttribute;
import java.awt.image.BufferedImage;
import java.text.AttributedString;
import java.util.Map;

import com.wxz.sanguo.common.LoadImage;

public class GameImageTool {

	private static Map<Integer, BufferedImage> generalImageMap = LoadImage
			.loadGenralImages();

	public static BufferedImage getGeneralImage(int generalId) {
		return generalImageMap.get(generalId);
	}

	public static void drawString(String rowString, int x, int y, int font,
			Color color, Graphics g) {
	
		AttributedString ats = new AttributedString(rowString);
	
		ats.addAttribute(TextAttribute.FONT, new Font(null, Font.BOLD, font),
				0, rowString.length());
	
		ats
				.addAttribute(TextAttribute.FOREGROUND, color, 0, rowString
						.length());
	
		g.drawString(ats.getIterator(), x, y);
	}
}
